package com.fangtao.test;

import com.fangtao.dao.RoleDAO;
import com.fangtao.domain.Role;
import com.fangtao.domain.User;
import com.fangtao.service.testService;
import com.fangtao.utils.JDBCUtilsByDruid;
import org.junit.jupiter.api.Test;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

/**
 * @ClassName test_JDBC
 * @Description TODO
 * @date 2022/9/22 13:34
 * @author: fangtao
 * @Version 1.0
 */
public class test_JDBC {

    private testService testservice=new testService();
    @Test
    public  void   test(){
        try {
            Connection connection = JDBCUtilsByDruid.getConnection();
            System.out.println(connection);
            JDBCUtilsByDruid.close(null,null,connection);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
    @Test
    public void login_test(){
        RoleDAO roleDAO=new RoleDAO();
        String sql="select * from smbms_role ;";
        List<Role> roles = roleDAO.queryMulti(sql, Role.class);
        for (Role role : roles) {
            System.out.println(role.toString());
        }


    }

}
